{extend name="/fool" /}
{block name="menu_content"}
<style>
    .yige{
        margin: 50px 30px 0 30px;
    }
    .yige div{
        margin:5px 0;
    }
</style>
<form class="layui-form" action="">
{foreach $list as $v}
<div class="yige">
    <div>贷款额度</div>
    <div class="layui-input-inline">
        <input type="text" name="money" value="{$v.money}" autocomplete="off" class="money layui-input">
    </div>
    <div>所需积分</div>
    <div class="layui-input-inline">
        <input type="text" name="integral" value="{$v.integral}"autocomplete="off" class="integral layui-input">
    </div>
    <div>
        <button sid="{$v.id}" type="button" class="bc layui-btn">保存</button>
    </div>
</div>
{/foreach}
</form>
<script>
    $(".bc").click(function(){
        var money = $(this).closest('.yige').find('.money').val();
        var integral = $(this).closest('.yige').find('.integral').val();
        var id = $(this).attr('sid');
        var url = "{:url('setup')}" + '?id=' +id;
        $.post(url,{money,integral},function(res){console.log(res)},'json');
    })
</script>
{/block}